package com.hqw.jzdemo;

import android.content.Intent;
import android.os.Bundle;

import com.facebook.react.ReactActivity;
import com.fengfei.ffadsdk.AdViews.Native.FFNativeManager;
import com.fengfei.ffadsdk.AdViews.Splash.FFSplashManager;
import com.fengfei.ffadsdk.Common.Util.FFAdLogger;

public class MainActivity extends ReactActivity {

    private FFSplashManager ffSplashManager;
    private FFNativeManager ffNativeManager;

    /**
     * Returns the name of the main component registered from JavaScript. This is used to schedule
     * rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "HqwJzDemo";
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ffSplashManager =  new FFSplashManager(this);
        ffNativeManager = new FFNativeManager(this);

//        startActivity(new Intent(this, Main2Activity.class));
    }

    @Override
    protected void onResume() {
        super.onResume();
        FFAdLogger.i("FFSplashManager.onResume()");
        if (ffSplashManager != null) ffSplashManager.onResume();
        FFAdLogger.i("FFNativeManager.onResume()");
        if (ffNativeManager != null) ffNativeManager.resume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        FFAdLogger.i("FFSplashManager.onPause()");
        if (ffSplashManager != null) ffSplashManager.onPause();
    }

    @Override
    protected void onStop() {
        super.onStop();
        FFAdLogger.i("FFSplashManager.onStop()");
        if (ffSplashManager != null) ffSplashManager.onStop();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        FFAdLogger.i("FFNativeManager.onDestroy()");
        if (ffNativeManager != null) ffNativeManager.destroy();
    }

    public FFSplashManager getFFSplashManager() {
        return ffSplashManager;
    }

//    public FFNativeManager getFFNativeManager() {
//        return ffNativeManager;
//    }

}
